home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1989 / Jul 89 / W0088-MacApp B9 doCreateV-Jul89 < prev    next >
Encoding:
Text File  |  1991-03-06  |  5.1 KB  |  132 lines  |  [TEXT/GEOL]

  1. Item    8379014                         19-July-89        07:40
  2.  
  3. From:   MUYSVASOVIC1                    ER&D - J-D Muys-Vasovic
  4.  
  5. To:     APPLE.BUGS                      Apple Bugs Reporting
  6.         MACAPP.TEST                     MacApp SQA Team
  7.  
  8. cc:     MUYSVASOVIC1                    ER&D - J-D Muys-Vasovic
  9.         MACAPP.TECH$                    MACAPP Tech
  10.         BURBECK.S                       Burbeck, Steve
  11.         FRIEDRICH1                      Friedrich, Steve
  12.         MACDTS                          Macintosh Developer Technical Supt.
  13.  
  14. Sub:    MacApp B9 doCreateViews bug
  15.  
  16. I just installed MacApp B9 (the real one), and discovered a new bug.
  17. The bug is in the TEvtHandler.DoCreateViews method, called from
  18. NewTemplateWindow.
  19.  
  20. The offending lines are the following:
  21.  
  22.    IF (lastParent = NIL) & (lastRoot <> NIL) THEN
  23.      IF aView <> NIL THEN
  24.        lastParent := aView.FindSubView(itsParentID)
  25.      ELSE
  26.        lastParent := lastRoot.FindSubView(itsParentID);
  27.  
  28. One previous version was:
  29.  
  30.    IF (lastParent = NIL) & (lastRoot <> NIL) THEN
  31.        lastParent := lastRoot.FindSubView(itsParentID);
  32.  
  33. They are executed when you want to find the already built parent of a new view.
  34. In my case, I called NewTemplateWindow for the following view resource:
  35.  
  36. resource 'view' (1001, purgeable) {
  37.    {
  38.    root, 'WIND', { 50, 20 }, { kWindowHeight, kWindowWidth },
  39.   sizeVariable, sizeVariable, shown, enabled,
  40.    Window  { "", zoomDocProc, noGoAwayBox, resizable, modeless,
  41.         ignoreFirstClick, freeOnClosing, disposeOnFree, closesDocument,
  42.        openWithDocument, dontAdaptToScreen,
  43.         stagger, forceOnScreen, dontCenter, 'TV02', "No Document" };
  44.  
  45.      'WIND', 'SCLR',   { 0, kCellWidth }, { kWindowHeight-kSBarSizeMinus1,
  46.                                    kWindowWidth-kSBarSizeMinus1-kCellWidth },
  47.    sizeRelSuperView, sizeRelSuperView, shown, enabled,
  48.    Scroller{ "", vertScrollBar, horzScrollBar, 0, 0, 16, 16,
  49.        vertConstrain, horzConstrain, { 0, 0, 0, 0 } };
  50.  
  51.      'WIND', 'TPal', { 0, 0 }, { 400, kCellWidth },
  52.      sizeFixed, sizeFixed, shown, enabled,
  53.    GridView{ "TPaletteView", 10, 1, kCellHeight, kCellWidth, 2, 2, AdornRows,
  54.                                                                   AdornCols,
  55.        singleSelection };
  56.  
  57.    'SCLR', 'TV02', { 0, 0 }, { kWindowHeight,
  58.                                      kWindowWidth-kSBarSizeMinus1-kCellWidth},
  59.      sizeFixed, sizeFixed, shown, disabled,
  60.      View  { "TView5"}
  61.      }
  62. };
  63.  
  64. The MacApp debugger tells me the following (run with intensive debugging on):
  65.  
  66. Command [  BCDEFGHILMOPπQRSßTWX?]: X
  67. Toggle Flag [abcefimprsUxD?]: I
  68. Intense debugging: TRUE
  69. Command [  BCDEFGHILMOPπQRSßTWX?]: G
  70. go…
  71. signature = 'wind'
  72. itsParentID = '    ', thisViewID = 'WIND'
  73. itsLocation = (20, 50), itsSize = (430, 280)itsHSizeDet =   4, itsVSizeDet =
  74. 4
  75. , isEnabled  = TRUE
  76. ----------  end of view  ----------
  77. signature = 'scrl'
  78. itsParentID = 'WIND', thisViewID = 'SCLR'
  79. itsLocation = (32, 0), itsSize = (383, 265)itsHSizeDet =   1, itsVSizeDet =   1
  80. , isEnabled  = TRUE
  81. ----------  end of view  ----------
  82. signature = 'sbar'
  83. itsParentID = '    ', thisViewID = '    '
  84. itsLocation = (0, 0), itsSize = (0, 0)itsHSizeDet =   4, itsVSizeDet =   4
  85. , isEnabled  = TRUE
  86. ----------  end of view  ----------
  87. signature = 'sbar'
  88. itsParentID = '    ', thisViewID = '    '
  89. itsLocation = (0, 0), itsSize = (0, 0)itsHSizeDet =   4, itsVSizeDet =   4
  90. , isEnabled  = TRUE
  91. ----------  end of view  ----------
  92. signature = 'grid'
  93. itsParentID = 'WIND', thisViewID = 'TPal'
  94. itsLocation = (0, 0), itsSize = (32, 400)itsHSizeDet =   5, itsVSizeDet =   5
  95. , isEnabled  = TRUE
  96. ----------  end of view  ----------
  97. signature = 'view'
  98. itsParentID = 'SCLR', thisViewID = 'TV02'
  99. itsLocation = (0, 0), itsSize = (383, 280)itsHSizeDet =   5, itsVSizeDet =   5
  100. , isEnabled  = FALSE
  101. ----------  end of view  ----------
  102. Unable to find subview: 'SCLR'
  103. ProgramBreak: !
  104. stopped at Break  TVIEW.FINDSUBVIEW Seg#: 24  Self: $002B04D8 is TPALETTEVIEW
  105. Command [  BCDEFGHILMOPπQRSßTWX?]: G
  106. go…
  107. ProgramBreak: Unable to find parent view for template
  108. stopped at Break  TEVTHANDLER.DOCREATEVIEWS Seg#: 12  Self: $002B069C is
  109. TVIEW5APPLICATION
  110. Command [  BCDEFGHILMOPπQRSßTWX?]: Q
  111. Exit to shell.  Are you sure [NY?]: Y
  112.  
  113.  
  114.  
  115. As you can see, the window is first correctly created, then the scroller and
  116. its two scroll bars, then the 'TPal' (palette) view. But the 'TV02' cannot be
  117. created. The reason why this happens is that aView is the 'TPal' view when the
  118. code gets executed, and of course, 'TPal'.FindSubView('SCLR') fails. The
  119. shortest version does not have this problem of course. I suppose the code was
  120. changed for efficiency reasons, to shorten the search of the parent view. It
  121. proves buggy however. Another proof of that is that if you swap the 'TPal' and
  122. 'TV02' descriptions in the resource, everything is OK. And the view should not
  123. depend on the order in which his components are described.
  124.  
  125. The question is: what is the best course to correct this? My best guess is
  126. still to change the code back to the previous, lest efficient code. I changed
  127. my UMacApp.TEvtHandler.p file accordingly, but it's clearly only a temporary
  128. fix.
  129.  
  130. Jean-Denis.
  131.  
  132.